/**
 * 
 */
package com.hera.base.web.vaadin.component;



import com.vaadin.ui.Label;
import com.vaadin.ui.Slider;
import com.vaadin.ui.VerticalLayout;

/**
 * @author cmontes
 *
 */
public class FormSlider extends VerticalLayout implements SimpleSelectable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 4690333850596898752L;
	
	private Slider control;
	private Label label;
	
	
	public FormSlider(){
		super();
		control = new Slider();
		label = new Label();
		addComponent(label);
		addComponent(control);
		setSize(100f);
	}
	
	public FormSlider(String value, String styleTextField){
		super();
		control = new Slider();
		control.addStyleName(styleTextField);
		this.label = new Label(value);
		addComponent(this.label);
		addComponent(control);
		setId(value +"12");
	}

	@Override
	public void setLabel(String value) {
		// TODO Auto-generated method stub
		label.setValue(value);
	}

	@Override
	public void setSize(Float value) {
		// TODO Auto-generated method stub
		control.setWidth(""+value + "px");
	}

	@Override
	public void setName(String value) {
		// TODO Auto-generated method stub
		setId(value);
	}

	@Override
	public String getLabel() {
		// TODO Auto-generated method stub
		return label.getValue();
	}

	@Override
	public Float getSize() {
		// TODO Auto-generated method stub
		return control.getWidth();
	}

	@Override
	public String getName() {
		// TODO Auto-generated method stub
		return getId();
	}	

}
